AddCSLuaFile("shared.lua")
include("shared.lua")

function ENT:Initialize()
	self:SetColor(Color(0,160,0,255))
	self:SetModel("models/props_junk/rock001a.mdl")
	self:PhysicsInit(SOLID_VPHYSICS)
	self:SetMoveType(MOVETYPE_VPHYSICS)
	self:SetSolid(SOLID_VPHYSICS)
	self:SetUseType(SIMPLE_USE)

	local phys = self:GetPhysicsObject()
	self.nodupe = true
	self.ShareGravgun = true

	phys:Wake()
end

--called when you use it (after it sets the high visual values and removes itself already)
function ENT:Use(activator,caller)
	--enhance sound (not really like it but close enough as far as computers go)
	activator:SetDSP(4);
	activator:SetGravity(0.2);
	self.Entity:Remove()
end

function ENT:SpawnFunction( ply, tr ) 
   
 	if ( !tr.Hit ) then return end 
 	 
 	local SpawnPos = tr.HitPos + tr.HitNormal * 16 
 	 
 	local ent = ents.Create("hash_ball") 
 	ent:SetPos( SpawnPos ) 
 	ent:Spawn() 
 	//ent:Activate()
 	//local phys = ent:GetPhysicsObject()
 	//phys:Wake()
 	 
 	return ent 
 	 
 end 


